import nGui.controls.Button;
import nGui.controls.containers.VBox;
import nGui.controls.Label;
import nGui.Manager;
import nGui.controls.containers.Dialog;

class ButtonSampleCallback
{
	public static function main()
	{
		var bs = new ButtonSampleCallback();
	}
	
	public function new()
	{
		var mng : Manager = new Manager();
		
		var vert : VBox = new VBox();
		var lbl : Label = new Label( "Click the button below" );
		var button1 : Button = new Button( "Click Me" );
		vert.appendChild( lbl );
		vert.appendChild( button1 );
		button1.onClick = function( val : Int )
		{
			lbl.text = "Button pressed = " + val;
			return null;
		}
		
		var wind : Dialog = new Dialog( vert );
		
		wind.title = "Buttons Sample";
		wind.show();
		
		mng.loop();
	}	
}